//
//  HMSegmented.m
//  PaternityClique
//
//  Created by macbook on 15/5/25.
//  Copyright (c) 2015年 macbook. All rights reserved.
//

#import "HMSegmented.h"

#define NavBarColor [UIColor colorWithRed:112/255 green:174/255.0 blue:78/255 alpha:1.0]
//#define BarColor [UIColor colorWithRed:95.0/255.0 green:146.0/255.0 blue:206.0/255.0 alpha:1.0]


@implementation HMSegmented
-(void)awakeFromNib{
    
    //设置hmSegmentedControl默认选择
    self.selectedSegmentIndex=0;
    //设置hmSegmentedControl的背景颜色
    self.backgroundColor=[UIColor whiteColor];
    //设置hmSegmentedControl的字体颜色
    self.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor grayColor]};
    //设置hmSegmentedControl的选中字体颜色
    self.selectedTitleTextAttributes=@{NSForegroundColorAttributeName : AppNavColor};
    //设置hmSegmentedControl的下方选择线的宽度适配风格
    self.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe;
    //设置线在上还是在下面
    self.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
    //设置线的宽度
    self.selectionIndicatorHeight=2.0;
    //设置线的颜色
    self.selectionIndicatorColor=AppNavColor;
    //添加分割线
    UIImageView *lineImg = [[UIImageView alloc] initWithFrame:CGRectMake(0,self.frame.size.height-0.5, ScreenWidth , 0.5)];
//    lineImg.image = [UIImage imageNamed:@"line.png"];
    lineImg.backgroundColor=[[UIColor grayColor]colorWithAlphaComponent:0.3];
    [self addSubview:lineImg];
    
}
@end
